"""meiduo_mall URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.urls import re_path, path
from verifications import views as veri_views
from users import views as users_views

urlpatterns = [
    re_path(r'^sms_codes/(?P<mobile>\d{11})/$', veri_views.SmsCodeVies.as_view()),                   # 发送短信验证码
    re_path(r'^usernames/(?P<username>\w{5,20})/count/$', veri_views.UsernameCountView.as_view()),   # 查询用户名的个数
    path('users/', veri_views.UserView.as_view()),                              # 注册用户
    path('user/', users_views.UserDetailView.as_view()),                        # 用户中心
    path('emails/', users_views.EmailView.as_view()),                           # 设置邮箱
    path('emails/verification/', users_views.EmailVerifyView.as_view()),        # 邮箱认证
    path('browse_histories/', users_views.UserBrowsingHistoryView.as_view()),   # 设置用户浏览历史
    path('authorizations/', users_views.UserAuthorizeView.as_view()),           # 用户登陆认证，重写了方法

]
